<template>
  <div id="app">
    <transition name="el-fade-in">
      <router-view />
    </transition>
  </div>
</template>
<script>
import { mapMutations, mapGetters } from "vuex";
export default {
  created() {
    this.setRefresh();
  },
  mounted() {
    this.$nextTick(() => {
      const val = this.getNowAct;
      const routeInfo = this.getHeaderTabs.find(item => val === item.path);
      console.log(routeInfo);
      document.title = routeInfo.title;
      console.log(document.title, routeInfo.title);
    });
  },
  computed: {
    ...mapGetters(["getNowAct", "getHeaderTabs"])
  },
  watch: {
    getNowAct(val) {
      const routeInfo = this.getHeaderTabs.find(item => val === item.path);
      document.title = routeInfo.title;
    }
  },
  methods: {
    ...mapMutations(["setRefresh"])
  }
};
</script>
<style lang="scss">
@import "styles/common.scss";
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  height: 100%;
  position: relative;
}
// 解决表格无法对齐问题
body .el-table th.gutter {
  display: table-cell !important;
}
.el-table th {
  display: table-cell !important;
}
body,
html {
  padding: 0 !important;
  margin: 0;
  height: 100%;
}
.viewMain > .el-scrollbar__bar.is-horizontal {
  display: none;
}
.viewMain > .el-scrollbar__wrap {
  overflow: hidden;
  overflow-x: hidden;
  overflow-y: scroll;
}
#appView {
  height: 100% !important;
}
#nav a {
  font-weight: bold;
  color: #2c3e50;
}
#nav a.router-link-exact-active {
  color: #42b983;
}

.el-header {
  height: 60px !important;
}
body {
  overflow: hidden;
}
.el-table {
  min-height: 420px !important;
  margin-top: 10px;
}
div.el-table td,
div.el-table td.is-center {
  text-align: center !important;
}
.el-table th {
  text-align: center !important;
}
.el-pagination {
  text-align: center !important;
  margin-top: 20px;
}
.el-table::before {
  height: 0 !important;
}

.posAbt {
  position: fixed;
  width: calc(100% - 220px);
  bottom: 0;
  background-color: $white;
  text-align: center;
  padding: 6px 0;
  left: 210px;
  /deep/.el-pagination {
    margin-top: 0;
  }
}
</style>
